package com.cn.wanxi.servlet;

import com.cn.wanxi.model.NewsModel;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet("/newsDetail")
public class NewsDetailServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
//       根据id返回不同的数据，然后添加到新闻详细页面
        NewsModel newsModel = new NewsModel();
        req.setAttribute("newsModel", newsModel);
        req.getRequestDispatcher("/jsp/newsDetail.jsp").forward(req, resp);
    }
}
